package com.monster.starter.core.common.config.http;

import lombok.Data;
import org.springframework.boot.context.properties.ConfigurationProperties;
import org.springframework.context.annotation.Configuration;

/**
 * 请求配置
 * @author kuang
 */
@Data
@Configuration("HttpRequestConfigStarter")
@ConfigurationProperties(prefix = "monster.http.request")
public class HttpRequestConfig {
    /**
     * 时间差距（毫秒）
     */
    private int timeGap = 0;
    /**
     * 请求头里面的时间戳key
     */
    private String timeName = "timestamp";
    /**
     * 数据加密的key在请求头里面的key
     */
    private String encryptName = "monster-en";
    /**
     * 请求验签
     */
    private boolean sign = true;
    /**
     * 请求头里面密钥编码
     */
    private String cipherName = "monster-cn";
    /**
     * 请求头里面眼前串
     */
    private String signName = "monster-sn";
    /**
     * token在请求头里面的传输
     */
    private String authTokenName = "x-auth-token";
    /**
     * 是否开启限流默认开启
     */
    private boolean limit = false;
    /**
     * 单多少时间内的最大访问次数
     */
    private int limitInitTime = 1;
    /**
     * 默认整体的的限流
     */
    private Double limitAll;
    /**
     * 默认单个方法限流
     */
    private Double limitOne;
    /**
     * 获取令牌超时时间
     */
    private int limitTimeOut = 5;
}
